import { LoginForm } from '@/api/auth/model/view';

/**
 * 记录登录账号密码
 * @param data 账号
 */
export function saveAccount(data: LoginForm) {
  if (!data.remember) {
    data.password = ""
  }
  localStorage.setItem('account', JSON.stringify(data));
}

/**
 * 读取登录账号密码
 */
export function getAccount() {
  return JSON.parse(localStorage.getItem('account') || '{}');
}
